#use "test07_parser.ml";;

let p = create ();;

let p = post (1, 2) '(' p;;
let p = post (3, 4) 'a' p;;
let p = post (5, 6) 'b' p;;
let p = post (7, 8) ')' p;;
let p = post (9, 9) '\x1a' p;; (* eof *)

flush stderr;;

if accepted p then (
	begin match result p with
	| Some (Some '(', ((3, 6), Some (Some 'a', Some 'b')), Some ')') ->
		begin match errors p with
		| [] ->
			print_string "OK.\n";
		| _ ->
			raise (Failure "BAD ERRORS DETECTED!!")
		end
	| _ ->
		raise (Failure "BAD RESULT!!")
	end
) else (
	raise (Failure "NOT ACCEPTED!!")
);;
